#include <bits/stdc++.h>
using namespace std;
int main() {
	double s,u;
	cin >> s >> u;
	int k = ceil(s/u) + 10;
	int ret = 8 * 60+24*60 - k;
	if(ret >= 24 * 60) ret -= 24 * 60;
	if ((ret / 60 < 10) && (ret%60<10)){
		cout <<0<< ret / 60 << ":" <<0<< ret % 60;
	}
	if(!(ret / 60 < 10) && (ret % 60 < 10)){
		cout << ret / 60 << ":" <<  0 << ret % 60;
	}
	if((ret / 60 < 10) && !(ret % 60 < 10)){
		cout << 0 << ret / 60 << ":" << ret % 60;
	}
	if(!(ret / 60 < 10) && !(ret % 60 < 10)){
		cout << ret / 60 << ":" << ret % 60;
	}
	return 0;
}
